import dateRangeUtil from "../common/date/dateRangeUtil";

export default {
    methods: {
        /**
         * 获取昨天
         * @returns {{end_date: *, start_date: *}}
         */
        $$$getYesterday () {
            const {dateFormat, getMonthDay, timeForMat} = this.$util
            const Yesterday = dateFormat(timeForMat(-1), "YYYY-MM-DD");
            return {
                end_date: Yesterday,
                start_date: Yesterday
            }
        },
        /**
         * 获取本周
         * @returns {{end_date: *, start_date: *}}
         */
        $$$getCurrentWeek () {
            const date = dateRangeUtil.getCurrentWeek()
            return {
                start_date: date[0],
                end_date: date[1],
            }
        },
        /**
         * 获取本月
         * @returns {{end_date: *, start_date: *}}
         */
        $$$getCurrentMonth () {
            const date = dateRangeUtil.getCurrentMonth()
            return {
                start_date: date[0],
                end_date: date[1]
            }
        },
        /**
         * 获取最近一周
         * @returns {{end_date: *, start_date: *}}
         */
        $$$getLastWeek () {
            const date = dateRangeUtil.getLastWeek()
            return {
                start_date: date[0],
                end_date: date[1]
            }
        }
    }
}
